/*
//
//               INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 2002-2006 Intel Corporation. All Rights Reserved.
//
*/

#ifndef __SAACDEC_STREAM_ELEMENTS_H
#define __SAACDEC_STREAM_ELEMENTS_H

#include "bstream.h"
#include "aaccmn_const.h"
#include "sbr_dec_struct.h"
#include "aac_dec_own.h"

#ifdef  __cplusplus
extern  "C" {
#endif

  Ipp32s  aacidec_ics_apply_scale_factors(s_SE_Individual_channel_stream *pData,
                                          Ipp32s *p_spectrum);
  Ipp32s  aacidec_cpe_apply_ms(sCpe_channel_element *pElement, Ipp32s *l_spec,
                               Ipp32s *r_spec);
  Ipp32s  aacidec_cpe_apply_intensity(sCpe_channel_element *pElement, Ipp32s *l_spec,
                                      Ipp32s *r_spec);

  Ipp32s  aacidec_apply_pns(s_SE_Individual_channel_stream *pDataL,
                            s_SE_Individual_channel_stream *pDataR,
                            Ipp32s *p_spectrumL,
                            Ipp32s *p_spectrumR,
                            Ipp32s numCh,
                            Ipp32s ms_mask_present,
                            Ipp32s ms_used[8][49],
                            Ipp32s *noiseState);

  Ipp32s  aacidec_deinterlieve(s_SE_Individual_channel_stream *pData,
                               Ipp32s *p_spectrum);

  void    aacidec_coupling_gain_calculation(sCoupling_channel_element *pElement,
                                            sCoupling_channel_data *pData,
                                            Ipp32s cc_gain[18][MAX_GROUP_NUMBER][MAX_SFB],
                                            Ipp32s cc_gain_factor[18][MAX_GROUP_NUMBER][MAX_SFB]);

  void    aacidec_coupling_spectrum(AACDec *state,
                                    sCoupling_channel_data *pData,
                                    Ipp32s *c_spectrum,
                                    Ipp32s curr_win_sequence,
                                    Ipp32s cc_gain[18][MAX_GROUP_NUMBER][MAX_SFB],
                                    Ipp32s cc_gain_factor[18][MAX_GROUP_NUMBER][MAX_SFB]);

  void    aacidec_coupling_samples(AACDec *state,
                                   sCoupling_channel_data *pData,
                                   Ipp32s *c_samlpes,
                                   Ipp32s cc_gain[18][MAX_GROUP_NUMBER][MAX_SFB],
                                   Ipp32s cc_gain_factor[18][MAX_GROUP_NUMBER][MAX_SFB]);

#ifdef  __cplusplus
}
#endif
#endif
